<script>
    layui.use(['form', 'layer', 'upload'], function() {
        var form = layui.form;

        form.on('radio(shareTo)', function(data){
            if (data.value == 1 || data.value == 2){
                form.val("form-user", {
                    "assign": 0,
                });
            }
        });

        form.on('select(assign)', function(data){
            if (data.value){
                $("input[name='shareTo']").each(function() {
                    $(this).removeAttr('checked');
                });
                $("#shareTo3").attr('checked','checked').prop("checked",true);
                form.render(); //更新全部
            }
        });
    });
</script>